package priv.ljh.operate.service.impl;

import org.springframework.stereotype.Service;
import priv.ljh.operate.entity.Order;

import priv.ljh.operate.mapper.OrderMapper;
import priv.ljh.operate.service.OrderService;


import javax.annotation.Resource;

import java.util.Date;
import java.util.List;

/**
 * @author ：Yshuaong
 * @date ：Created in 2021/6/21 14:28
 * @description：
 * @modified By：
 * @version: $
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderMapper orderMapper;
    @Override
    public List<Order> getAllOrder(int uid) {
        return orderMapper.getAllOrder(uid);
    }

    @Override
    public int insertOrder( String title, int number, String img_url, String sell_price, int flag, int uid) {
        Date add_time=new Date();
        return orderMapper.insertOrder( title, number,  img_url,  sell_price,  flag, add_time, uid);
    }

    @Override
    public int deleteOrder(int oid) {
        return orderMapper.deleteOrder(oid);
    }
}
